﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GLYFrom.DengLu
{
    public partial class ZhuCe : Form
    {
        public ZhuCe()
        {
            InitializeComponent();
        }

        private void ZhuCe_Load(object sender, EventArgs e)
        {

        }

        private void label3_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            string Name = this.text_Name.Text.Trim();
            string Sex = "男";
            if (this.radio_nu.Checked)
            {
                Sex = "女";
            }
            string ZhangHao = this.text_ZhangHao.Text.Trim();
            string MiMa = this.text_MiMa.Text.Trim();
            string DianHua = this.text_SJH.Text.Trim();
            if (this.text_MiMa.Text.Trim()!=this.text_QRMiMa.Text.Trim())
            {
                MessageBox.Show("注册失败,两次密码输入不相同！");
                return;
            }
            if (Name.Length > 0 && Sex.Length > 0 && ZhangHao.Length > 0 && MiMa.Length > 0 && DianHua.Length > 0)
            {
                int sr = DBHelper.ZSG(string.Format("insert into T_YongHu values('{0}','{1}','{2}','{3}','{4}','{5}')", Name, Sex, ZhangHao, MiMa, DianHua, 0));
                if (sr > 0)
                {
                    MessageBox.Show("注册成功！");
                }
                else
                {
                    MessageBox.Show("注册失败！");
                }
            }
            else
            {
                MessageBox.Show("注册失败,请填写完整！");
                return;
            }
        }

        private void label8_Click(object sender, EventArgs e)
        {
            DengLu.denglu from = new denglu();
            from.Show();
            this.Close();
        }
    }
}
